<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="css/bootstrap-responsive.css"/>
<link rel="stylesheet" type="text/css" href="css/doc.css"/>
<style type="text/css">
body {
font-family: "ff-tisa-web-pro-1","ff-tisa-web-pro-2","Lucida Grande","Helvetica Neue",Helvetica,Arial,"Hiragino Sans GB","Hiragino Sans GB W3","Microsoft YaHei UI","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;
}
</style>
<title>regist</title>
</head>
<body ng-app="app">
	<div class="container-fluid">
		<div class="row-fluid" style="padding-top: 80px" ng-controller="dataCtrl">     
			<div class="span4">&nbsp;</div>
			<div class="span4">   
			   <form class="bs-docs-example form-horizontal" ng-submit="submit()" name="dataForm">
					<div class="control-group">
						<label class="control-label" for="username"><font color="red">*</font> 用户名：</label>  
						<div class="controls">
							<input class="input-medium" id="username" type="text" ng-model="dvlp.username" required ng-minlength="4" ng-maxlength="10" ng-pattern="/^[A-Za-z0-9]+$/" placeholder="用户名">&nbsp;<span class="help-inline">{{usernameTips}}</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label"><font color="red">*</font> 账户类型：</label>
						<div class="controls">
							<label class="radio inline">
                                  <input type="radio"  ng-model="dvlp.type"  value="1"> 公司
                            </label>
							<label class="radio inline">
                                  <input type="radio"  ng-model="dvlp.type"  value="2"> 个人
                            </label>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="name"><font color="red">*</font> 个人姓名：</label>  
						<div class="controls">
							<input class="input-medium" type="text" id="name" ng-model="dvlp.name" required placeholder="个人姓名">&nbsp;<span class="help-inline">{{nameTips}}</span>
						</div>
					</div>
					<div class="control-group">  
						<label class="control-label" for="email"><font color="red">*</font> 电子邮箱：</label>  
						<div class="controls">
							<input class="input-medium" type="email" id="email" ng-model="dvlp.email" required placeholder="电子邮箱">&nbsp;<span class="help-inline">{{emailTips}}</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="password"><font color="red">*</font> 密码：</label>  
						<div class="controls">
							<input class="input-medium" type="password" id="password" ng-model="dvlp.password" required ng-minlength="6" ng-maxlength="10" ng-pattern="/^[A-Za-z0-9]+$/"  placeholder="密码">&nbsp;<span class="help-inline">{{passwordTips}}</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="conformpassword"><font color="red">*</font> 确认密码：</label>  
						<div class="controls">
							<input class="input-medium" type="password" id="conformpassword" ng-model="dvlp.conformpassword" required ng-minlength="6" ng-maxlength="10" ng-pattern="/^[A-Za-z0-9]+$/" placeholder="密码">&nbsp;<span class="help-inline">{{conformpasswordTips}}</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="phone"><font color="red">*</font> 手机号码：</label>  
						<div class="controls">
							<input class="input-medium" type="text" id="phone" ng-model="dvlp.phone" required ng-pattern="/^1[3|4|5|8][0-9]\d{4,8}$/" placeholder="手机号码">&nbsp;<span class="help-inline">{{phoneTips}}</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="commcode">其他方式：</label>  
						<div class="controls">
							<select class="span1" name="comm" ng-model="dvlp.comm" style="width:65px"><option value="QQ">QQ</option><option value="MSN">MSN</option></select>&nbsp;
							<input class="input-medium" type="text" id="commcode" ng-model="dvlp.commcode" ng-pattern="/^[0-9]+$/" placeholder="其他方式">&nbsp;<span class="help-inline">{{commcodeTips}}</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="verficode"><font color="red">*</font> 验证码 ：</label>  
						<div class="controls">
							<input class="input-mini" type="text" id="verficode" ng-model="dvlp.verficode" required  placeholder="验证码">&nbsp;<span class="help-inline"><a href="">{{verficodeTips}}</a></span>
						</div>  
					</div>
				    <div class="row-fluid">
			          <div class="span4">&nbsp;</div>
			          <div class="span8">
			              <div class="control-group">  
							<div class="controls" style="margin-left:0px;">  
								<label class="checkbox"><input type="checkbox">我已阅读并同意 <a href=""><font color="red">隐私政策</font></a>&nbsp;和&nbsp;<a href=""><font color="red">服务条款</font></a></label>
								<button type="submit" class="btn btn-large" style="width: 120px">注册</button>  
						    </div>  
				         </div>
			          </div>
			        </div>
				</form>
			 </div>  
			<div class="span4">&nbsp;表单验证：{{dataForm.$valid}}  {{dataForm.$error}}</div>
	</div>
</body>
</html>
<script type="text/javascript" src="scripts/angular.min.js"></script>
<script type="text/javascript" src="scripts/include.postload.js"></script>
<!--[if lte IE 8]>
<script type="text/javascript" src="../scripts/json2.js"></script>
<![endif]-->
<!--[if lte IE 9]>
<script type="text/javascript" src="../scripts/html5shiv.js"></script>
<![endif]-->
<script type="text/javascript">
<!--
    angular.module("app",[],function($provide){
	
     }).controller("dataCtrl",function($scope,$window,$http){
    	 $scope.usernameTips = "4-10个字符(数字 字母)组成";
    	 $scope.nameTips = "请填写真实姓名";
    	 $scope.emailTips = "请填写正确的邮箱,方便找回密码,查收报表";
    	 $scope.passwordTips = "6-10个字符(数字 字母)组成";  
    	 $scope.conformpasswordTips = "6-10个字符(数字 字母)组成";
    	 $scope.phoneTips = "手机。。。。,请认真填写";
    	 $scope.verficodeTips = "看不清楚换图片";
		 $scope.dvlp = {type:"1",comm:"QQ"};
		 $scope.submit = function() {
        //$window.alert($scope.dvlp);
        //$http.get('/someUrl').success(successCallback);
        //$http.post('/someUrl', data).success(successCallback);
         $http.post("http://localhost:8080/XMPP-open/dvlp/add", $scope.dvlp).success(function(data, status) {
             $window.alert("success");
             $window.alert(data);
             $window.alert(status);
         }).error(function(data, status) {
             $window.alert("error");
             $window.alert(data);
             $window.alert(status);
         });
         };

     });
//-->
</script>
